<?php $__env->startSection("content"); ?>
<div class="layui-container fly-marginTop fly-user-main">
    <ul class="layui-nav layui-nav-tree layui-inline" lay-filter="user">
        <li class="layui-nav-item">
            <a href="/user/<?php echo e(\Auth::id()); ?>">
                <i class="layui-icon">&#xe609;</i>我的主页</a></li>
        <li class="layui-nav-item  layui-this">
            <a href="/user/myquestion">
                <i class="layui-icon">&#xe612;</i>用户中心</a></li>
        <li class="layui-nav-item ">
            <a href="<?php echo e(url('/user/set')); ?>">
                <i class="layui-icon">&#xe620;</i>基本设置</a></li>
        <li class="layui-nav-item ">
            <a href="/user/msg/<?php echo e(\Auth::id()); ?>">
                <i class="layui-icon">&#xe611;</i>我的消息</a></li>
        <li class="layui-nav-item ">
            <a href="/auth/get/">
                <i class="layui-icon">&#xe61e;</i>产品授权</a></li>
    </ul>
    <div class="site-tree-mobile layui-hide">
        <i class="layui-icon">&#xe602;</i></div>
    <div class="site-mobile-shade"></div>
    <div class="fly-panel fly-panel-user" pad20>
        <div class="layui-tab layui-tab-brief" lay-filter="user" id="LAY_uc">
            <div class="fly-msg">您的邮箱尚未验证，这比较影响您的帐号安全，
                <a href="/user/activate/">立即去激活？</a></div>
            <ul class="layui-tab-title" id="LAY_mine">
                <li data-type="mine-jie" lay-id="index" class="layui-this">我发的帖（
                    <span><?php echo e($user->question_count); ?></span>）</li>
                <li data-type="collection" data-url="/collection/find/" lay-id="collection">我收藏的帖（
                    <span><?php echo e($user->collect_count); ?></span>）</li></ul>
            <div class="layui-tab-content" id="LAY_ucm" style="padding: 20px 0;">
                <div class="layui-tab-item layui-show">
                    <ul class="mine-view jie-row">
                        <?php $__currentLoopData = $questions; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $question): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <li>
                            <a class="jie-title" href="/question/<?php echo e($question->id); ?>/show" target="_blank"><?php echo e($question->title); ?></a>
                            <i><?php echo e($question->created_at->diffForHumans()); ?> 发帖</i>
                        </li>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </ul>
                    <div id="pull_right">
                        <div class="pull-right">
                            <?php echo e($questions->links()); ?>

                        </div>
                    </div>
                </div>
                <div class="layui-tab-item">
                    <ul class="mine-view jie-row">
                        <?php $__currentLoopData = $collects; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $collect): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <li>
                                <a class="jie-title" href="/question/<?php echo e($collect->question->id); ?>/show" target="_blank"><?php echo e($collect->question->title); ?></a>
                                <i><?php echo e($collect->created_at->diffForHumans()); ?> 发帖</i>
                            </li>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </ul>
                    <div id="pull_right">
                        <div class="pull-right">
                            <?php echo e($collects->links()); ?>

                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<script>
    layui.use('element', function() {
        var element = layui.element;
        var layid = location.hash.replace(/^#user=/, '');
        element.tabChange('user', layid); //假设当前地址为：http://a.com#test1=222，那么选项卡会自动切换到“发送消息”这一项

        //监听Tab切换，以改变地址hash值
        element.on('tab(user)', function(){
            location.hash = 'question='+ this.getAttribute('lay-id');
        });
    })
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make("layout.main", array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>